package com.main;

import com.constants.Constants;
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
public class Main extends Application {

    public static boolean zhiding = false;
    @Override
    public void start(Stage primaryStage) throws Exception{
        Parent root = FXMLLoader.load(getClass().getClassLoader().getResource(Constants.fxmlPath+"main.fxml"));
        primaryStage.setTitle(Constants.title);
        //设置窗口的图标.
        primaryStage.getIcons().add(Constants.icoImage);
        primaryStage.setResizable(false);
        primaryStage.setScene(new Scene(root, 850, 450));
        primaryStage.setAlwaysOnTop(zhiding);
        primaryStage.show();
        primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
            @Override
            public void handle(WindowEvent event) {
                System.exit(0);
            }
        });
    }
    public static void main(String[] args) {
        launch(args);
    }
}
